import { App } from 'vue'
import CrudTable from './CrudTable.vue'
import { PJ_REQUEST_METHOD, PJ_REQUEST_KEY } from '../../token'
import { _request, _keys } from '../../util'

export default {
  install(app: App, {requestMethod = _request, requestKeys = {}} = {}) {
    app.provide(PJ_REQUEST_METHOD, requestMethod)
    app.provide(PJ_REQUEST_KEY, Object.assign(_keys, requestKeys))
    app.component('CrudTable', CrudTable)
  }
}
